import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:yysk_app/utils/helper.dart';
import 'package:yysk_app/utils/upgrade_notice_dialog.dart' show TextImgWithGradient;
import 'package:yysk_app/widget/image_asset_widget.dart' show ImageAssetWidget;

Future<dynamic> showDanationChoosePlatformDialog({
  required BuildContext context,
}) async {
  return await showDialog<dynamic>(
    context: context,
    barrierDismissible: false,
    useSafeArea: false,
    builder: (context) => const DanationChoosePlatform(),
  );
}

class DanationChoosePlatform extends StatelessWidget {
  const DanationChoosePlatform({super.key});
  @override
  Widget build(BuildContext context) {

    final double bottom = MediaQuery.of(context).viewInsets.bottom;
    return Material(
      color: Colors.black.withAlpha(30),
      child: Stack(
        alignment: Alignment.bottomCenter,
        children: [
            
        // Container(
        //         padding: EdgeInsets.only(right: 10.px, top: 97.px),
        //         alignment: Alignment.topRight,
        //         child: TextImgWithGradient(
        //           fontFamily: 'CustomFont',
        //             startColor: Color(0xff284235),
        //             endColor: Color.fromARGB(255, 145, 183, 165),
        //             imgUrl: 'static/images/upgrade/upgrade_close.png',
        //             imWidth: 29.px,imHeight: 29.px,
        //             onPressed: (){
                    
        //               Navigator.of(context).pop();
        //             },
   
        //           ),
        //       ),
          Align(
            alignment: Alignment.bottomCenter,
            child: ClipRRect(
              borderRadius: const BorderRadius.vertical(
                top: Radius.circular(32),
              ),
              child: Container(
                width: double.infinity,
                height: MediaQuery.of(context).size.height * 0.6 + bottom,
                color: Colors.white,
                padding: EdgeInsets.only(
                  left: 0,
                  right: 0,
                  top: 62,
                  bottom: bottom > 0 ? bottom : 32,
                ),
                child: Stack(
                 
                  children: [
                    
                    Column(
                      mainAxisSize: MainAxisSize.min,
                      children: [
                        const SizedBox(height: 8),
                        const Text(
                          '转赠',
                          style: TextStyle(
                            fontSize: 22,
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                        const SizedBox(height: 24),
                       
                       Column(
                            children: [
                                ListTile(
                                 
                                  title: Text(
                                    '内部转赠',
                                    style: const TextStyle(fontSize: 18, fontWeight: FontWeight.normal),
                                  ),
                                  trailing: const Icon(
                                    Icons.arrow_forward_ios,
                                    size: 18,
                                    color: Colors.black26,
                                  ),
                                  contentPadding: const EdgeInsets.symmetric(horizontal: 24),
                                  onTap: () {
                                   Get.back(result: '1');       
                                  },
                                  minVerticalPadding: 18,
                                ),
                                const Divider(
                                  height: 1,
                                  thickness: 1,
                                  indent: 24,
                                  endIndent: 24,
                                  color: Color(0xFFF2F2F2),
                                ),
                                 ListTile(
                                
                                  title: Text(
                                    '转至臻藏',
                                    style: const TextStyle(fontSize: 18, fontWeight: FontWeight.normal),
                                  ),
                                  trailing: const Icon(
                                    Icons.arrow_forward_ios,
                                    size: 18,
                                    color: Colors.black26,
                                  ),
                                  contentPadding: const EdgeInsets.symmetric(horizontal: 24),
                                  onTap: () {
                                     
                                            Get.back(result: '2');    
                                  },
                                  minVerticalPadding: 18,
                                ),
                                const Divider(
                                  height: 1,
                                  thickness: 1,
                                  indent: 24,
                                  endIndent: 24,
                                  color: Color(0xFFF2F2F2),
                                ),
                             
                            ],
                          ),
                        const SizedBox(height: 16),
                      ],
                    ),
                    // 右上角关闭按钮
                    Positioned(
                      right: 16,
                      top: 0,
                      child: GestureDetector(
                        onTap: () {
                            Get.back(result: '0');  
                        },
                        child: Container(
                          width: 40,
                          height: 40,
                          decoration: BoxDecoration(
                            color: Colors.white,
                            shape: BoxShape.circle,
                            boxShadow: [
                              BoxShadow(
                                color: Colors.black.withOpacity(0.08),
                                blurRadius: 8,
                              ),
                            ],
                          ),
                          child: const Icon(Icons.close, size: 24),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ),
             Positioned(
                    top: 260.px,
                    child:  ImageAssetWidget(
                        imageUrl: 'static/images/hansome_man.png',
                        width: 69.px,
                        height: 88.px,
                        fit: BoxFit.fitWidth,
                    ),), 
  Positioned(
                    top: 280.px,
                    left: 0,
                    child:  ImageAssetWidget(
                        imageUrl: 'static/images/leaf_left.png',
                        width: 73.px,
                        height: 51.px,
                        fit: BoxFit.fitWidth,
                    ),), 


        ],
      ),
    );
  }

 
 
 
}
